﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace RN.ERP.Entity.ZBDLRY
{
    #region CA_Cert CA 证书注册记录
    /// <summary>
    /// CA 证书注册记录
    /// </summary>
    public class CA_Cert
    {
        [Key]
        public Guid CertID { get; set; }
        public Guid AppID { get; set; }
        /// <summary>
        /// 0-企业 1-个人
        /// </summary>
        public Boolean EntityType { get; set; }
        /// <summary>
        /// 实体(企业、个人)GUID
        /// </summary>
        public Guid EntityGuid { get; set; }
        /// <summary>
        /// 证书实体名称
        /// </summary>
        public String EntityName { get; set; }
        /// <summary>
        /// 组织机构代码或身份证号
        /// </summary>
        public String EntityID { get; set; }
        /// <summary>
        /// 电子邮件
        /// </summary>
        public String Email { get; set; }
        /// <summary>
        /// 受理鉴证日期
        /// </summary>
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
        public DateTime AppDate { get; set; }
        /// <summary>
        /// 鉴证用户(RA管理员)
        /// </summary>
        public String VerifyUser { get; set; }
        /// <summary>
        /// 鉴证管理证书签名(实体名、邮箱、日期yyyy-mm-dd、用户)
        /// </summary>
        public String VerifySign { get; set; }
        /// <summary>
        /// 注册日期
        /// </summary>
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
        public DateTime EnrollDate { get; set; }
        /// <summary>
        /// 注册用户(RA管理员)
        /// </summary>
        public String EnrollUser { get; set; }
        /// <summary>
        /// 组织机构代码或个人证件号 ID=
        /// </summary>
        public String AdditionalField1 { get; set; }
        /// <summary>
        /// 福莱证书标识
        /// “FCA” + 4字节16进制字符，共7字节，
        /// 后4字节为MD5的前4字节（大写），
        /// MD5由名称+邮件的域名运算得出
        /// </summary>
        public String AdditionalField2 { get; set; }
        /// <summary>
        /// 预留OU字段
        /// </summary>
        public String AdditionalField3 { get; set; }
        /// <summary>
        /// 注册上传BUFF
        /// </summary>
        public String RequestBufP7 { get; set; }
        /// <summary>
        /// 注册管理证书签名(实体名、邮箱、日期yyyy-mm-dd、用户)
        /// </summary>
        public String EnrollSign { get; set; }
        /// <summary>
        /// 有效期截止日
        /// </summary>
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
        public DateTime ValidityTo { get; set; }
        /// <summary>
        /// 是否写入Key
        /// </summary>
        public Boolean CertIssued { get; set; }
        public String CertSerialNumber { get; set; }
        public String CertKmcSerialNumber { get; set; }
        /// <summary>
        /// 注册返回BUFF
        /// </summary>
        public String CertSignBufP7 { get; set; }
        public String KeySerialNo { get; set; }
        /// <summary>
        /// 制作Key日期
        /// </summary>
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
        public DateTime IssueDate { get; set; }
        /// <summary>
        /// 0-有效 1-吊销 2-挂起 3-过期
        /// </summary>
        public Byte Status { get; set; }
        public String certSignBuf { get; set; }
        public String certSignBufKmc { get; set; }
        public String kmcReq1 { get; set; }
        public String kmcReq2 { get; set; }
        public String kmcReq3 { get; set; }
        public String kmcRep1 { get; set; }
        public String kmcRep2 { get; set; }
        public String kmcRep3 { get; set; }
    }
    #endregion CA_Cert CA 证书注册记录

}
